<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>AutoCompleteSearchBox</title>
    <link rel='stylesheet' href="../css/style.css" />
    <script src='../js/jquery-1.11.2.min.js'></script>
    <script src="AutoCompleteSearchBox.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $('#searchshow').searchshow({
                itemnum: 15,
                tffloat: false
            });
        });

        function submit_data() {
            var datasore = $('#searchshow');
            if (datasore.text() == '' || datasore.val() == '')
                return false;
            var sArr = datasore.text().split(" ")
            var str = datasore.val();
            str = str.replace(sArr[1], sArr[0]);
            alert(str);
        }
    </script>
</head>

<body>
    <form>
        <input value="" type="text" id="searchshow" autocomplete="off" datasrc="json.json" textcol="t1as" inputcol="inputcol" valcol="valuecol">
        <input value="提交" type="submit" onclick="submit_data()">
    </form>
</body>

</html>